﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Longbow.Service;

namespace Longbow
{
	class AssemblyModuleLoader
	{





		public AssemblyModuleRef[] Load()
		{
			return null;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="fileName">Assembly module file full name</param>
		public void Load(string fileName)
		{
			Assembly moduleAssembly = Assembly.LoadFile(fileName);
			if (moduleAssembly != null)
			{
				Type[] types = moduleAssembly.GetTypes();
				foreach (Type type in types)
				{
					Type it = type.GetInterface("IAssemblyModule");
					if (it != null)
					{
						// found the Service Module
						ConstructorInfo ci = type.GetConstructor(new Type[] { });
						object o = ci.Invoke(new object[] { });
						IAssemblyModule module = o as IAssemblyModule;

					}
				}
			}
		}

		
	}
}
